<?php /* PROJECTS $Id: do_project_aed.php,v 1.11.10.4 2006/07/25 20:24:13 merlinyoda Exp $ */
$obj = new CProject();
$project_id = intval( dPgetParam( $_GET, 'project_id', 0 ) );
$obj->load($project_id);
$reasons = $obj->canProcess();
if($reasons != NULL) {
	$AppUI->setMsg( '<p/>'.$reasons, UI_MSG_ERROR );
	$AppUI->redirect();
	exit;
}

require_once(DP_BASE_DIR."/modules/masterdata/mdstatus.class.php");
$processed_status = new CMDStatus();
$project_processed = dPgetSysVal( 'ProjectProcessed' );
$processed_status->loadByCode($project_processed[0]);

$obj->project_rstatus = $processed_status->status_id;
if (($msg = $obj->store())) {
	$AppUI->setMsg( $msg, UI_MSG_ERROR );
	$AppUI->redirect();
	exit;
}

$AppUI->setMsg( "Project is processed", UI_MSG_OK, true );
$AppUI->redirect();
?>
